﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Common.Utilities.Excel
{
    /// <summary>
    /// Excel操作错误类型
    /// </summary>
    public enum MessageType
    {
        /// <summary>
        /// Config
        /// </summary>
        [EnumMember(Value = "Config")]
        Config = 0,
        /// <summary>
        /// Config
        /// </summary>
        [EnumMember(Value = "Event")]
        Event = 0,
        /// <summary>
        /// Workbook
        /// </summary>
        [EnumMember(Value = "Workbook")]
        Workbook,
        /// <summary>
        /// Worksheet
        /// </summary>
        [EnumMember(Value = "Worksheet")]
        Worksheet,
        /// <summary>
        /// Area
        /// </summary>
        [EnumMember(Value = "Area")]
        Area,
        /// <summary>
        /// Row
        /// </summary>
        [EnumMember(Value = "Row")]
        Row,
        /// <summary>
        /// Cell
        /// </summary>
        [EnumMember(Value = "Cell")]
        Cell
    }

    public enum ExcelResultType
    {
        /// <summary>
        /// 导入失败
        /// </summary>
        [EnumMember(Value = "Failed")]
        Failed = 0,
        /// <summary>
        /// 导入取消
        /// </summary>
        [EnumMember(Value = "Canceled")]
        Canceled,
        /// <summary>
        /// 完成, 但有异常
        /// </summary>
        [EnumMember(Value = "CompletedWithException")]
        CompletedWithException,
        /// <summary>
        /// Worksheet
        /// </summary>
        [EnumMember(Value = "Succeed")]
        Succeed
    }

    /// <summary>
    /// 工作表状态
    /// </summary>
    public enum WorksheetStatus
    {
        /// <summary>
        /// 本Sheet无问题, 继续读取
        /// </summary>
        [EnumMember(Value = "Continue")]
        Continue = 0,
        /// <summary>
        /// 跳过本Sheet, 处理下一Sheet
        /// </summary>
        [EnumMember(Value = "Skip")]
        Skip,
        /// <summary>
        /// 取消处理
        /// </summary>
        [EnumMember(Value = "Canceled")]
        Canceled
    }

    /// <summary>
    /// 区域状态
    /// </summary>
    public enum AreaStatus
    {
        /// <summary>
        /// 本区域无问题, 继续读取
        /// </summary>
        [EnumMember(Value = "Continue")]
        Continue = 0,
        /// <summary>
        /// 跳过本区域, 处理下一Sheet
        /// </summary>
        [EnumMember(Value = "Skip")]
        Skip,
        /// <summary>
        /// 取消处理
        /// </summary>
        [EnumMember(Value = "Canceled")]
        Canceled
    }

    /// <summary>
    /// 行状态
    /// </summary>
    public enum RowStatus
    {
        /// <summary>
        /// 本行无问题, 继续读取
        /// </summary>
        [EnumMember(Value = "Continue")]
        Continue = 0,
        /// <summary>
        /// 跳过本行, 处理下一行
        /// </summary>
        [EnumMember(Value = "Skip")]
        Skip,
        /// <summary>
        /// 本Sheet处理结束, 导出Excel时此值无效
        /// </summary>
        [EnumMember(Value = "Finish")]
        Finish,
        /// <summary>
        /// 取消处理
        /// </summary>
        [EnumMember(Value = "Canceled")]
        Canceled
    }

    /// <summary>
    /// 单元格状态
    /// </summary>
    public enum CellStatus
    {
        /// <summary>
        /// 本单元格无问题, 继续处理下一单元格
        /// </summary>
        [EnumMember(Value = "Continue")]
        Continue = 0,
        /// <summary>
        /// 忽略此行, 处理下一行
        /// </summary>
        [EnumMember(Value = "Finish")]
        IngoreRow,
        /// <summary>
        /// 取消处理
        /// </summary>
        [EnumMember(Value = "Canceled")]
        Canceled
    }
}
